using System.Management.Automation;

namespace PSSymbolStore.Commands
{
    public abstract class SymbolStoreCommandBase : PSCmdlet
    {
        [Parameter(Position = 0,
            Mandatory = true,
            ValueFromPipeline = false,
            ValueFromPipelineByPropertyName = true,
            ValueFromRemainingArguments = false,
            HelpMessage = "The symbol store"), ValidateNotNullOrEmpty]
        public string SymbolStore { get; set; }

        protected SymbolStore SymbolStoreObject { get; set; }

        protected virtual bool CreateSymbolStore
        {
            get { return false; }
        }

        protected override void BeginProcessing()
        {
            SymbolStoreObject = new SymbolStore(this, SymbolStore);
            SymbolStoreObject.Open(CreateSymbolStore);

            base.BeginProcessing();
        }
    }
}
